<?php
class Zend_Validate_ConfirmPassword extends Zend_Validate_Abstract
{
const PASSWORD='password';
protected $_front;
protected $_messageTemplates = array(
self::PASSWORD => "Пароли не совпадают");
	public function isValid($value)
	{

	$this->_setValue($value);
	   $_front = Zend_Controller_Front::getInstance();

	$pass1=$_front->getRequest()->getParam('password');
	$pass2=$_front->getRequest()->getParam('confirmpassword');

	if(!empty($pass1) && !empty($pass2)){
		if($pass1!==$pass2){
		$this->_error(self::PASSWORD);
		return false;
		}
		if($pass1===$pass2)
		{
		return true;
		}
				 
	}
  }
}
